<?php
	####################################################
	# library import and object instance.              #
	####################################################
	# 커먼 인클루드
	include_once( '../common.php' );

	####################################################
	# request data($_POST AND $_GET FROM $_REQUEST)    #
	####################################################
	# REQUEST(get and post variables)
	$req = Request::clean_request($_REQUEST, FALSE);

	# GET(url variables)

	# POST(form variables)

	# Validation(special case validate)

	####################################################
	# implementation                                   #
	####################################################
	//*/
	# 로그인 지속
	$sign_duration_cookie = Cookier::get("sign_duration_cookie");
	if($sign_duration_cookie) {
		$decompose_sign_duration = Cookier::decompose($sign_duration_cookie);
		$duration_y = $decompose_sign_duration[0];
		$duration_id = Cipher::decrypt( $decompose_sign_duration[1] );
		//Nlog::puts('sign_duration_cookie', $sign_duration_cookie );
		//Nlog::puts('decompose_sign_duration', $decompose_sign_duration );
		//Nlog::puts('duration_id', $duration_id );
	}
	$msg = empty($msg) ? '관리자 아이디/비밀번호를 입력 하십시오': $msg;
	if(!empty($req['mode'])){
		switch($req['mode']){
			case 'false':
				$msg = '관리자의 아이디 비밀번호를 확인 하십시오.';
			break;
			case 'signout':
				$msg = '사인 아웃 되었습니다.';
			break;
			default:break;
		}
	}
	//*/

?>
<?php
	# HTML START
	echo $tplt->page_construct_javascript();
	echo $html->custom_js("{$JS}common.js");
	echo $html->custom_css("{$CSS}common.css");
?>

	<table id="login_wrapper" border="0" width="100%" height="100%" cellspacing="0" cellpadding="0" valign="middle" align="center">
		<tr>
			<td valign="middle" align="center">
				<?php echo NForm::open(NULL, FALSE, "sign");?>
					<?php echo NForm::mode('signin')?>
					<div id="login">
						<span class="title"></span>
						<div class="container">
							<div class="ipt_total_wrapper">
								<div class="iptwrapper mart15">
									<input type="text" name="id" id="id" class="input" value="<?=@$duration_id?>" />
								</div>
								<div class="iptwrapper">
									<input type="password" name="passwd" id="passwd" class="input" value="" />
								</div>
								<div class="iptwrapper tal marl60">
									<input type="checkbox" name="sign_duration" id="sign_duration" value="y" <?=NForm::checked($duration_y, 'y');?>/>
									<label for="sign_duration">아이디 기억하기</label>
								</div>
							</div>
							<div class="submitwrapper">
								<input type="image" src="/img/signinbtn.png" value="login" />
							</div>
							<span class="msg"><?php echo $msg?></span>
						</div>
					</div>
					<div class="signcp">Copyright (c) Developer Naiyumie. All rights reserved.</div>
				<?php echo NForm::close();?>
			</td>
		</tr>
	</table>

<?php
	# HTML END
	echo $tplt->page_destruct_javascript();
	include_once( '../endproc.php' );
	echo $html->html_footer();
?>